package com.wwwarehouse.taskcenter.bean.job_point;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Jackie on 2017/11/15.
 * 查询已设置作业点规则请求结果实体
 */

public class JobPointSetRuleResponseBean implements Parcelable {

    /**
     * list : [{"tempInatanceName":"作业点规则1","tempInstanceId":"32147300000002000"},{"tempInatanceName":"作业点规则1","tempInstanceId":"52146002043156000"},{"tempInatanceName":"作业点规则2","tempInstanceId":"52146806895027000"}]
     * page : 1
     * size : 20
     * total : 3
     */

    private int page;
    private int size;
    private int total;
    private List<JobPointRuleDetailsBean> list;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public List<JobPointRuleDetailsBean> getList() {
        return list;
    }

    public void setList(List<JobPointRuleDetailsBean> list) {
        this.list = list;
    }

    public static class JobPointRuleDetailsBean implements Parcelable {
        /**
         * tempInatanceName : 作业点规则1
         * tempInstanceId : 32147300000002000
         */

        private String tempInatanceName;
        private String tempInstanceId;
        private boolean isSelect;

        public String getTempInatanceName() {
            return tempInatanceName;
        }

        public void setTempInatanceName(String tempInatanceName) {
            this.tempInatanceName = tempInatanceName;
        }

        public String getTempInstanceId() {
            return tempInstanceId;
        }

        public void setTempInstanceId(String tempInstanceId) {
            this.tempInstanceId = tempInstanceId;
        }

        public boolean isSelect() {
            return isSelect;
        }

        public void setSelect(boolean select) {
            isSelect = select;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.tempInatanceName);
            dest.writeString(this.tempInstanceId);
            dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
        }

        public JobPointRuleDetailsBean() {
        }

        protected JobPointRuleDetailsBean(Parcel in) {
            this.tempInatanceName = in.readString();
            this.tempInstanceId = in.readString();
            this.isSelect = in.readByte() != 0;
        }

        public static final Creator<JobPointRuleDetailsBean> CREATOR = new Creator<JobPointRuleDetailsBean>() {
            @Override
            public JobPointRuleDetailsBean createFromParcel(Parcel source) {
                return new JobPointRuleDetailsBean(source);
            }

            @Override
            public JobPointRuleDetailsBean[] newArray(int size) {
                return new JobPointRuleDetailsBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.page);
        dest.writeInt(this.size);
        dest.writeInt(this.total);
        dest.writeTypedList(this.list);
    }

    public JobPointSetRuleResponseBean() {
    }

    protected JobPointSetRuleResponseBean(Parcel in) {
        this.page = in.readInt();
        this.size = in.readInt();
        this.total = in.readInt();
        this.list = in.createTypedArrayList(JobPointRuleDetailsBean.CREATOR);
    }

    public static final Creator<JobPointSetRuleResponseBean> CREATOR = new Creator<JobPointSetRuleResponseBean>() {
        @Override
        public JobPointSetRuleResponseBean createFromParcel(Parcel source) {
            return new JobPointSetRuleResponseBean(source);
        }

        @Override
        public JobPointSetRuleResponseBean[] newArray(int size) {
            return new JobPointSetRuleResponseBean[size];
        }
    };
}
